package com.glela.common.exception;

import com.glela.platform.constant.ErrorEnum;

/**
 * @author liujie
 *
 * 业务端异常基类
 */
public class PlatformException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * 业务异常的错误编码
	 */
	private ErrorEnum errorEnum;
	/**
	 * 获取业务异常的错误编码
	 * @return 业务异常的错误编码
	 */
	public ErrorEnum getErrorEnum(){
		return this.errorEnum;
	}
	
	/**
	 * 业务异常构造函数
	 * @param businessError
	 * @param msg
	 */
	public PlatformException(ErrorEnum errorEnum,String message){
		super(message);
		this.errorEnum = errorEnum;
	}
	
	/**
	 * 业务异常构造函数
	 * @param businessError
	 * @param message
	 * @param cause
	 */
	public PlatformException(ErrorEnum errorEnum, String message, Throwable cause) {
        super(message, cause);
        this.errorEnum = errorEnum;
    }
	public PlatformException(String msg) {
		super(msg);
	}

}
